@extends('layout/index')


@section('main')

<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span><i class="icon-user"></i>显示用户</span> 
    </div>


    <div class="mws-panel-body no-padding">
    	<form action="/Admin/user/index" method="get">
        <div role="grid" class="dataTables_wrapper" id="DataTables_Table_1_wrapper">
       		 <div id="DataTables_Table_1_length" class="dataTables_length">
		       	 <label>显示
		       	 <select name="num" size="1" aria-controls="DataTables_Table_1">
			        <option value="10" selected="selected">10</option>
			        <option value="25" 
			        	@if(!empty($request['num']) && $request['num']==25)
			   			 selected
			        	@endif
			        	>25</option>
			        <option value="50" 
			        	@if(!empty($request['num']) && $request['num']==50)
			        	selected
						@endif		        	
			        	>50</option>
			        <option value="100" 
			        	@if(!empty($request['num']) && $request['num']==100)
			        	selected
						@endif	
    					>100</option>
		       	 </select>条数据</label>
       		 </div>
       		 <div class="dataTables_filter" id="DataTables_Table_1_filter">
	       		   <label>关键字: 
	       		    <input type="text" name="search" aria-controls="DataTables_Table_1" value="{{$request['search'] or ''}}">
	               <button class="btn btn-info">点击搜索</button>
	               </label>
	                </form>
	               	<a href="/Admin/user/index" style="color:#31BAD4;font-size:18px;">返回</a>
              
            </div>
	        <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
	            <thead>
	                <tr role="row" style="height:80px">
	                <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 6px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">ID</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 55px;" aria-label="Browser: activate to sort column ascending">用户名</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 50px;" aria-label="Browser: activate to sort column ascending">图片</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 35px;" aria-label="Browser: activate to sort column ascending">昵称</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 35px;" aria-label="Browser: activate to sort column ascending">性别</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 35px;" aria-label="Browser: activate to sort column ascending">金币</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 25px;" aria-label="Browser: activate to sort column ascending">邮箱</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 40px;" aria-label="Browser: activate to sort column ascending">注册IP</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 60px;" aria-label="Engine version: activate to sort column ascending">状态</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 85px;" aria-label="Engine version: activate to sort column ascending">会员等级</th>
	                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 80px;" aria-label="CSS grade: activate to sort column ascending">操作</th></tr>
	            </thead>
		        <tbody role="alert" aria-live="polite" aria-relevant="all">
		         @foreach($row as $k => $v)
	 			 <tr class=" {{$k%2==0?'odd':'even'}}">
				    <td class="id" class="sorting_1">{{ $v->id }}</td>
				    <td class=" ">{{ $v->username }}</td>
				    <td class=" ">
				    @if($v->picname)
				    <img src="{{ $v->picname }}" alt="" style="height:60px" width="100%">
					@else
					 <img src="/upload/1.jpg" alt="" style="height:60px" width="100%">
					 @endif
				    </td>
				    <td class=" ">{{ $v->nickname }}</td>
				    <td class=" ">{{ getSex($v->sex) }}</td>
					<td class=" ">{{ $v->gold }}</td>
					<td class=" ">{{ $v->email }}</td>
					<td class=" ">{{ $v->regip }}</td>
				    <td class=" ">{{ getStatus($v->status) }}</td>
				    <td class=" ">{{ getLevel($v->level) }}</td>
				    <td class=" "><a href="/Admin/user/edit?id={{ $v->id }}">修改</a> | <a href="/Admin/user/delete?id={{ $v->id }}">删除</a></td>
				 </tr>
				@endforeach
				</tbody>
			</table>
			<div class="dataTables_info" id="DataTables_Table_1_info">显示分页</div>
			<div class="dataTables_paginate paging_full_numbers" id="page">
				{!! $row->appends($request)->render() !!}
			 </div>
		</div>
    </div>
</div>

@endsection